#ifndef URLEXTRACTER_H
#define URLEXTRACTER_H

#include <QObject>
#include <QNetworkAccessManager>
#include <QNetworkReply>


namespace FileTransfer {


class UrlExtracter : public QObject
{
    Q_OBJECT

public:
    UrlExtracter(QObject *parent = 0);
    ~UrlExtracter();

private:
    QString m_starting;
    QString m_ending;
    QNetworkAccessManager *m_manager;
    QNetworkReply *m_reply;
    QByteArray m_pageData;
    bool m_isFirst;
    bool m_isAborted;

public slots:
    void getUrl(const QString &pageUrl);
    void abort();

private slots:
    void readyRead();
    void finished();

signals:
    void done(const QString &url);
};

} // namespace FileTransfer

#endif // URLEXTRACTER_H
